package com.yyge.config;

import org.springframework.stereotype.Component;

import java.util.*;

/**
 * <p> 全局常用变量 </p>
 *
 * @author : gityyge
 * @description :
 */
@Component
public class Constants {

    /**
     *
     */
    public static String COLON = ":";
    /**
     * 接口url
     */
    public static Map<String, String> URL_MAPPING_MAP = new HashMap<>();

    /**
     * 获取项目根目录
     */
    public static String PROJECT_ROOT_DIRECTORY = System.getProperty("user.dir");

    /**
     * 密码加密相关
     */
    public static String SALT = "gityyge";
    public static final int HASH_ITERATIONS = 1;

    /**
     * 请求头 - token
     */
    public static final String REQUEST_HEADER = "X-Token";

    /**
     * 请求头类型：
     * application/x-www-form-urlencoded ： form表单格式
     * application/json ： json格式
     */
    // public static final String REQUEST_HEADERS_CONTENT_TYPE = "application/x-www-form-urlencoded";
    public static final String REQUEST_HEADERS_CONTENT_TYPE = "application/json";

    /**
     * session中的存储的token
     */
    public static final String CURRENT_TOKEN = "CURRENT_TOKEN";

    /**
     * session中的当前登录用户
     */
    public static final String CURRENT_USER = "CURRENT_USER";

    /**
     * 角色id，code
     */
    public static final String ROLE_ADMIN = "admin";
    public static final String ROLE_DANIU = "daniu";
    public static final String ROLE_CUSTOMER = "customer";
    public static final Byte ROLE_LOGIN_MANAGER = 1;
    public static final Byte ROLE_LOGIN_CUSTOMER = 2;

    /**
     * 登录者角色
     */
    public static final String ROLE_LOGIN = "role_login";
}
